{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/Avatar/index.tsx\";\nimport React from \"react\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Avatar = props => {\n  if (props.contentList && props.contentList.items && props.contentList.items.length > 0) {\n    return /*#__PURE__*/_jsxDEV(\"img\", {\n      className: \"avatar\",\n      src: props.contentList.items[0].link,\n      alt: 'Avatar ' + props.alt\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 9,\n      columnNumber: 13\n    }, this);\n  } else {\n    const {\n      colors\n    } = generateAvatarByNickname(props.stringForGenerateColor);\n    const firstChar = props.stringForFirstCharacter[0].toUpperCase();\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      style: {\n        background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`\n      },\n      className: \"avatar avatar--symbol\",\n      children: firstChar\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 16,\n      columnNumber: 13\n    }, this);\n  }\n};\n_c = Avatar;\nexport default Avatar;\nvar _c;\n$RefreshReg$(_c, \"Avatar\");","map":{"version":3,"names":["React","generateAvatarByNickname","Avatar","props","contentList","items","length","link","alt","colors","stringForGenerateColor","firstChar","stringForFirstCharacter","toUpperCase","background","color","colorLighten"],"sources":["/data/messenger.client/src/components/Avatar/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {AvatarProps} from \"../../models/props/AvatarProps\";\nimport { generateAvatarByNickname } from \"../../utils/helpers\";\nimport './Avatar.scss';\n\nconst Avatar: React.FC<AvatarProps> = (props) => {\n    if (props.contentList && props.contentList.items && props.contentList.items.length > 0) {\n        return (\n            <img className='avatar' src={props.contentList.items[0].link} alt={'Avatar ' + props.alt}/>\n        );\n    } else {\n        const {colors} = generateAvatarByNickname(props.stringForGenerateColor);\n        const firstChar = props.stringForFirstCharacter[0].toUpperCase();\n\n        return (\n            <div\n                style={{background: `linear-gradient(135deg, ${colors.color} 0%, ${colors.colorLighten} 96.52%)`}}\n                className='avatar avatar--symbol'\n            >\n                {firstChar}\n            </div>\n        );\n    }\n}\n\nexport default Avatar;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,wBAAwB,QAAQ,qBAAqB;AAC9D,OAAO,eAAe;AAAC;AAEvB,MAAMC,MAA6B,GAAIC,KAAK,IAAK;EAC7C,IAAIA,KAAK,CAACC,WAAW,IAAID,KAAK,CAACC,WAAW,CAACC,KAAK,IAAIF,KAAK,CAACC,WAAW,CAACC,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;IACpF,oBACI;MAAK,SAAS,EAAC,QAAQ;MAAC,GAAG,EAAEH,KAAK,CAACC,WAAW,CAACC,KAAK,CAAC,CAAC,CAAC,CAACE,IAAK;MAAC,GAAG,EAAE,SAAS,GAAGJ,KAAK,CAACK;IAAI;MAAA;MAAA;MAAA;IAAA,QAAE;EAEnG,CAAC,MAAM;IACH,MAAM;MAACC;IAAM,CAAC,GAAGR,wBAAwB,CAACE,KAAK,CAACO,sBAAsB,CAAC;IACvE,MAAMC,SAAS,GAAGR,KAAK,CAACS,uBAAuB,CAAC,CAAC,CAAC,CAACC,WAAW,EAAE;IAEhE,oBACI;MACI,KAAK,EAAE;QAACC,UAAU,EAAG,2BAA0BL,MAAM,CAACM,KAAM,QAAON,MAAM,CAACO,YAAa;MAAS,CAAE;MAClG,SAAS,EAAC,uBAAuB;MAAA,UAEhCL;IAAS;MAAA;MAAA;MAAA;IAAA,QACR;EAEd;AACJ,CAAC;AAAA,KAlBKT,MAA6B;AAoBnC,eAAeA,MAAM;AAAC;AAAA"},"metadata":{},"sourceType":"module"}